package com.example.service;

import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Component("indexNameProvider")
public class IndexNameProvider {
    public String getIndexName() {
        // 返回动态索引名，可以从配置、上下文等获取
        return "products_" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
    }
}
